package cn.wolfcode.cloud.productapi.service.feigh;

import cn.wolfcode.cloud.productapi.domian.Product;
import cn.wolfcode.cloud.productapi.service.ProductFeignApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component //直接交给spring管理
@Slf4j
public class ProductFeignHystrix implements ProductFeignApi {

    @Override
    public Product getProduct(Long productId) {
        log.info("商品服务断路...");
        Product product = new Product();
        product.setName("兜底数据");
        product.setPrice(0);
        product.setStock(0);
        return product;
    }
}
